import java.util.HashSet;
import java.util.Scanner;

public class TestDay30 {

    //最难的问题
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            String str = scanner.nextLine();
            StringBuilder stringBuilder = new StringBuilder();
            for (int i = 0; i < str.length(); i++) {
                char ch = str.charAt(i);
                if(ch >= 'A' && ch - 5< 'A'){
                    int sum = 5;
                    sum = sum - (ch-'A'+ 1);
                    stringBuilder.append((char) ('Z'-sum));
                }else if(ch <= 'Z' && ch >= 'F'){
                    stringBuilder.append((char) (ch-5));
                }else {
                    stringBuilder.append((char) (ch));
                }
            }
            System.out.println(stringBuilder);
        }

    }
    //因数个数
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
       //     int n = scanner.nextInt();
            String str = scanner.nextLine();
            StringBuilder stringBuilder = new StringBuilder();
            for (int i = 0; i < str.length(); i++) {
                int sum = 0;
                while ( i < str.length() && str.charAt(i) >= '0' && str.charAt(i) <= '9') {
                    sum = str.charAt(i) - '0' + sum * 10;
                    i++;
                }

                if (sum != 0)
                    stringBuilder.append((char) (func1(sum) + '0'));

                if(i != str.length())
                stringBuilder.append(str.charAt(i));
            }
            System.out.println(stringBuilder);
        }
    }

    //效率高
    public static int func1(int n){
        int count = 0;
        for(int i = 2;i <= Math.sqrt(n);i++){
            if(n % i == 0){
                while(n % i == 0){
                    n /= i;
                }
                count++;
            }
        }
        if(n != 1){
            count++;
        }
         return count;
    }
    //20 2 2 5
    //21 3 7
    //28 2 2 7
    //121 11 11
    //可以保证的是最后一个没有出现的因数一定是大于当前n的开方
    public static int func(int n){

        HashSet<Integer> hashSet = new HashSet<>();
        int sum = n;
        for (int i = 2; i <= sum ; i++) {
            while (n % i == 0){
                n /= i;
                hashSet.add(i);
            }
            if(n == 1){
                break;
            }
        }
        return hashSet.size();
    }
}
